package com.peng.controller;

import com.peng.pojo.User;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {
    @GetMapping("/hello")
    public String hello(){
        return "hello";
    }

    @PostMapping("/user")
    @ApiOperation("操作用户")
    public User user(){
        return new User();
    }

    @PostMapping("/user2")
    @ApiOperation("chuangdi用户")
    public User user(@ApiParam("传递一个user对象") User user){
        return user;
    }
}
